#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
int a[N+100];
int n;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int i,j,s=0;
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&a[i]);
    }
    sort(a+1,a+n+1);
    j=1;
    for(i=1;j<=n&&i<=n;){
        while(j<=n&&a[j]<=a[i]) j++;
        if(j==n+1) break;
        s++;i++;j++;
    }
    cout<<n-s<<endl;
    fclose(stdin);
    fclose(stdout);
    return 0;
}
